CD pipeline to auto-publish package updates to npm#4
Conversation
WalkthroughIntroduces a new GitHub Actions workflow that orchestrates continuous integration, publishing, and release processes. The workflow triggers on version tag pushes, executing sequential pipelines for code quality checks, npm package publication with provenance, and automated GitHub release creation. Changes
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/publish.yml:
- Around line 68-69: The publish step named "Publish to npm" calls "npm publish
--provenance --access public" but lacks the NODE_AUTH_TOKEN environment variable
required by actions/setup-node for npm authentication; update that step to set
env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} (ensure a valid NPM_TOKEN secret
exists) so the "npm publish" command can authenticate successfully with the
registry configured by actions/setup-node.
🧹 Nitpick comments (1)
.github/workflows/publish.yml (1)
47-66: Consider caching build artifacts to reduce redundancy.The
ciandpublishjobs both perform checkout, dependency installation, and build steps. Whilst this ensures a clean build, you could optimise by uploading build artifacts from thecijob and downloading them inpublish.This is optional as the current approach is straightforward and ensures reproducibility.
♻️ Optional: Share artifacts between jobs
In the
cijob, after the build step:- name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: dist path: dist/In the
publishjob, replace the install/build steps:- name: Download build artifacts uses: actions/download-artifact@v4 with: name: dist path: dist/ - name: Install dependencies run: npm ci --omit=dev
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.